package com.hk.web.controller;

import com.hk.commons.entity.order.OrderInfo;
import com.hk.service.order.IOrderInfo;
import com.hk.service.product.IProductInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.math.BigDecimal;

/**
 * Created by Sheldon Chen on 2016/12/9.
 */
@Controller
public class TestController {

    @Autowired
    private IProductInfo productInfoService;

    @Autowired
    private IOrderInfo orderInfoService;

    @RequestMapping(value = "test")
    public String test() {

        OrderInfo orderInfo = this.orderInfoService.findById(1466054396285L);

        this.productInfoService.updAmountByPay(orderInfo.getProductId(), BigDecimal.valueOf(1500), true);

        return "hello world";
    }
}
